package cn.njupt;
import cn.njupt.printer.BinaryTrees;
import cn.njupt.tree.AVLTree;
import cn.njupt.tree.BST;
public class Test {
    public static void main(String[] args) {
        BST<Integer> tree=new AVLTree<>((a, b)->a-b);
        int[] arr=new int[]{86, 55, 28, 96, 94, 45, 79, 30, 12, 15, 14, 47, 39, 44, 38, 64, 42, 90, 7};
        for (int i = 0; i < arr.length; i++) {
            tree.add(arr[i]);
            BinaryTrees.println(tree);
        }
//        Visitor<Person> visitor=new Visitor<Person>() {
//            @Override
//            public boolean visit(Person element) {
//                System.out.println(element.getAge());
//                return element.getAge()==2?true:false;
//            }
//        };
//        tree.preOrderTraversal(tree.getRoot(),visitor);
        BinaryTrees.println(tree);

    }
}
